Sync up with Parsoid parserTests.txt
authorSubramanya Sastry <ssastry@wikimedia.org>
Tue, 20 Mar 2018 16:09:40 +0000 (11:09 -0500)
committerSubramanya Sastry <ssastry@wikimedia.org>
Tue, 20 Mar 2018 16:11:32 +0000 (11:11 -0500)
This now aligns with Parsoid commit 3f79aa9fd48e68d32d1b9bdc3e29ec4536f297b8

Change-Id: I12249e39ddc6e3344a9dd8a1545b129ed469e184

tests/parser/parserTests.txt

index 261bce1..3f4ecad 100644 (file)
@@ -9776,6 +9776,10 @@ Multiple list tags generated by templates
 </li><li>b
 </li><li>c
 </li>
+!! html/parsoid
+<li about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[0,44,null,null],"pi":[[{"k":"1"}],[{"k":"1"}],[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;li>"}},"i":0}},"a\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;li>"}},"i":1}},"b\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;li>"}},"i":2}},"c"]}'>a
+</li><li about="#mwt1">b
+</li><li about="#mwt1" data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[null,44,null,0]}'>c</li>
 !!end
 
 !!test
@@ -13038,10 +13042,14 @@ Templates: Wiki Tables: 1a. Fostering of entire template content
 a
 <tr><td></td></tr></table>
 
-!! html+tidy
+!! html/php+tidy
 
 a
 <table><tbody><tr><td></td></tr></tbody></table>
+!! html/parsoid
+<p about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"fostered":true,"autoInsertedEnd":true,"firstWikitextNode":"TABLE","pi":[[{"k":"1"}]]}' data-mw='{"parts":["{|\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a"}},"i":0}},"\n|}"]}'>a</p><table about="#mwt2">
+
+</table>
 !! end
 
 !!test
@@ -17391,9 +17399,8 @@ Media link with nasty text
 !! html/php
 <a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link&lt;div style="display:none"&gt;" onmouseover="alert(document.cookie)" onfoo="&lt;/div&gt;</a>
 
-!! html+php/tidy
-<p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link</a></p>
-<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div>
+!! html/php+tidy
+<p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link</a></p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg"><div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div></a>
 !! html/parsoid
 <p><a rel="mw:MediaLink" href="//example.com/images/3/3a/Foobar.jpg" title="Foobar.jpg" data-parsoid='{"autoInsertedEnd":true}'>Safe Link</a></p><div style="display:none" data-parsoid='{"stx":"html"}'><a rel="mw:MediaLink" href="//example.com/images/3/3a/Foobar.jpg" title="Foobar.jpg" data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'>" onmouseover="alert(document.cookie)" onfoo="</a></div>
 
@@ -23129,6 +23136,7 @@ Line two</blockquote>
 Line two</p></blockquote>
 !! end
 
+# Parsoid's output is broken on this because of Tidy-compatibility cruft
 !! test
 T8200: paragraphs inside blockquotes (extra line break on close)
 !! wikitext
@@ -23524,7 +23532,7 @@ comment
 Bad images - basic functionality
 !! wikitext
 [[File:Bad.jpg]]
-!! DISABLED/html/php
+!! html/php+disabled
 !! html/parsoid
 <p><span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"bad-image","message":"This image is blacklisted in this context."}]}'><a href="./File:Bad.jpg"><img resource="./File:Bad.jpg" height="220" width="220"/></a></span></p>
 !! end
@@ -23535,7 +23543,7 @@ Bad images - T18039: text after bad image disappears
 Foo bar
 [[File:Bad.jpg]]
 Bar foo
-!! DISABLED/html/php
+!! html/php+disabled
 <p>Foo bar
 </p><p>Bar foo
 </p>
@@ -27703,7 +27711,7 @@ parsoid=html2wt
 !! html/parsoid
 <ul><li>a<br>b</li><li>c</li></ul>
 !! wikitext
-* a<br>b
+* a<br />b
 * c
 !! end
 
@@ -28403,9 +28411,9 @@ parsoid=html2wt,wt2wt
 |<nowiki>- </nowiki>
 |-
 |<small>-</small>
-|<br>
+|<br />
 -
-|<br>
+|<br />
 -
 |}
 !! html/php+tidy
@@ -28858,7 +28866,7 @@ parsoid={
 !! html/parsoid
 <h2>foo<br/>bar</h2>
 !! wikitext
-== foo<br> bar ==
+== foo<br /> bar ==
 !! end
 
 !! test
@@ -29938,6 +29946,9 @@ wgFragmentMode=[ 'html5', 'legacy' ]
 <h2><span class="mw-headline" id="Foo_bar">Foo&#160;bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <p><a href="#Foo_bar">#Foo&#160;bar</a>
 </p>
+!! html/parsoid
+<h2 id="Foo_bar"> Foo<span typeof="mw:Entity" data-parsoid='{"src":"&amp;nbsp;","srcContent":" "}'> </span>bar </h2>
+<p><a rel="mw:WikiLink" href="./Main_Page#Foo_bar" data-parsoid='{"stx":"simple","a":{"href":"./Main_Page#Foo_bar"},"sa":{"href":"#Foo&amp;nbsp;bar"}}'>#Foo bar</a></p>
 !! end
 
 !! test